<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<!DOCTYPE HTML>
<html>
<head>
<title>登录页面</title>
<meta http-equiv=Content-Type content="text/html; charset=utf-8">

<link rel="stylesheet" href="<%=basePath%>css/style1.css">

<script src=
       "<%=basePath%>js/jquery-1.11.3.min.js">
</script>
<meta content="MSHTML 6.00.2600.0" name=GENERATOR>
<script>
// 判断是登录账号和密码是否为空
function check(){
    var usercode = $("#usercode").val();
    var password = $("#password").val();
    if(usercode=="" || password==""){
    	$("#message").text("账号或密码不能为空！");
        return false;
    }  
    return true;
}
function check_one(){
    var user_name = $("#user_name").val();
    var user_password= $("#user_password").val();
    if(user_name=="" || user_password==""){
    	$("#message_one").text("注册的账号或密码不能为空！");
        return false;
    }  
    return true;
}
</script>
</head>
<body style="background-image:url(<%=basePath%>images/bj2.jpg);background-size:cover ">
    <div class="content">
        <div class="form sign-in">
            <h2>欢迎回来</h2>
            <form action="${pageContext.request.contextPath }/login.action"
			                       method="post" onsubmit="return check()">
                 <label>
                    <span>账号</span>
                    <input id="usercode" type="text" name="usercode" />
                </label>
           		<label>
                    <span>密码</span>
                     <input id="password" type="password" name="password" />
                </label>
          <p class="forgot-pass"><a href="javascript:">忘记密码？</a></p>
            <button type="submit" class="sub">登 录</button>
            <button type="button" class="fb-btn">使用 <span>微信</span> 帐号登录</button>
            <font color="red">
			 <%-- 提示信息--%>
			 <center><span id="message">${msg}</span></center>
			</font>
            </form>
        </div>
        
        <div class="sub-cont">
            <div class="img">
                <div class="img__text m--up">
                    <h2>还未注册？</h2>
                    <p>立即注册！</p>
                </div>
                <div class="img__text m--in">
                    <h2>已有帐号？</h2>
                    <p>有帐号就登录吧，好久不见了！</p>
                </div>
                <div class="img__btn">
                    <span class="m--up">注 册</span>
                    <span class="m--in">登 录</span>
                </div>
            </div>
            <!-- 注册页面 -->
            <div class="form sign-up" >
                <h2>立即注册</h2>
               <form action="${pageContext.request.contextPath }/add.action"
			                       method="post" onsubmit="return check_one()">
                 <label>
                    <span>账号</span>
                    <input id="user_name" type="text" name="user_name" />
                </label>
           		<label>
                    <span>密码</span>
                     <input id="user_password" type="password" name="user_password" />
                </label>
            <button type="submit" class="sub" >注册并登录</button>
            <button type="button" class="fb-btn">使用 <span>微信</span> 帐号注册</button>
            <font color="red">
			 <%-- 提示信息--%>
			 <center><span id="message_one">${msg}</span></center>
			</font>
            </form>
            
            </div>
        </div>
    </div>

    
	<script src="js/script.js"></script>
	<div style="text-align:center;">
</div>
</body>

</html>